package io.lkt.modules.sys.service.impl;

import io.lkt.commons.dynamic.datasource.annotation.DataSource;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.lkt.common.utils.PageUtils;
import io.lkt.common.utils.Query;

import io.lkt.modules.sys.dao.BPosterDetailsDao;
import io.lkt.modules.sys.entity.BPosterDetailsEntity;
import io.lkt.modules.sys.service.BPosterDetailsService;

import javax.annotation.Resource;


@Service("bPosterDetailsService")
public class BPosterDetailsServiceImpl extends ServiceImpl<BPosterDetailsDao, BPosterDetailsEntity> implements BPosterDetailsService {

    @Resource
    BPosterDetailsDao bPosterDetailsDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<BPosterDetailsEntity> page = this.page(
                new Query<BPosterDetailsEntity>().getPage(params),
                new QueryWrapper<BPosterDetailsEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    @DataSource("master")
    public List<BPosterDetailsEntity> queryAll(BPosterDetailsEntity bPosterDetails) {
        bPosterDetails.setStatus(1);
        return bPosterDetailsDao.queryAll(bPosterDetails);
    }

}
